﻿using System.Drawing;

namespace RoMBot
{
    public class LogItem
    {
        public string Text { get; set; }

        public Color Color { get; set; }

        public LogType Type { get; set; }

        public LogItem( string text )
        {
            this.Text = text;
            this.Color = Color.Black;
            this.Type = LogType.Normal;
        }

        public LogItem( string text, Color color )
            : this( text )
        {
            this.Color = color;
        }

        public LogItem( string text, LogType type )
            : this( text )
        {
            this.Type = type;
            switch ( this.Type )
            {
                case LogType.Debug:
                    this.Text = "[DEBUG]: " + this.Text;
                    this.Color = Color.Green;
                    break;
                case LogType.Warning:
                    this.Text = "[Warning]: " + this.Text;
                    this.Color = Color.Orange;
                    break;
                case LogType.Error:
                    this.Text = "[ERROR]: " + this.Text;
                    this.Color = Color.Red;
                    break;
            }
        }

        public LogItem( string text, LogType type, Color color )
            : this( text, type )
        {
            this.Color = color;
        }
    }
}